package com.alibaba.middleware.hsf.protostuff;

import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.runtime.RuntimeSchema;

/**
 * @author weipeng2k 2017年12月27日 上午11:16:49
 */
public class Bug {
    public static void main(String[] args) {
        RuntimeSchema<Noop> schema = RuntimeSchema.createFrom(Noop.class);
        byte[] array = ProtostuffIOUtil.toByteArray(new Noop(), schema,
                LinkedBuffer.allocate(LinkedBuffer.DEFAULT_BUFFER_SIZE));
        System.out.println(array.length);

        Noop message = schema.newMessage();
        ProtostuffIOUtil.mergeFrom(array, message, schema);
        System.out.println(message);
    }
}
